﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InventoryManagement
{
    public static class InventoryManagement
    {
        public static SqlParameter AddSqlParm(string ParmName, object Value, SqlDbType Sqltype)
        {
            return AddSqlParm(ParmName, Value, Sqltype, -1);
        }

        public static SqlParameter AddSqlParm(string ParmName, object Value, SqlDbType Sqltype, int SqlSize)
        {
            SqlParameter genSqlData;
            if ((SqlSize == -1))
                genSqlData = new SqlParameter(ParmName, Sqltype);
            else
                genSqlData = new SqlParameter(ParmName, Sqltype, SqlSize);
            if ((Value == null))
                genSqlData.Value = DBNull.Value;
            else
                genSqlData.Value = Value;
            return genSqlData;
        }
    }
}
